<template>
	<view>
		<navBar title="停车记录"></navBar>
		<view class="top-bg"></view>
		<view class="content">
			<view class="tab">
				<view class="tab-item" :class="{'active':query.type===1}" @click="handleTab(1)">
					<view>临时车辆</view>
					<view class="line"></view>
				</view>
				<view class="tab-item" :class="{'active':query.type===2}" @click="handleTab(2)">
					<view>月卡车辆</view>
					<view class="line"></view>
				</view>
			</view>
			<view v-if="list.length">
				<view class="car-no-panel" v-for="item in list" :key="item.id"
					@click="go('/pages/indoor/parkingDetails',item)">
					<view class="title">
						<view class="title-left">
							<image class="icon-car" :src="bg_image.iconCar"></image>
							<text class="car-no-title">{{item.plateNumber || ''}}</text>
						</view>
						<text :class="{'status-yellow':item.statusStr==='已完成','status-blue':item.statusStr==='停车中'}">{{item.statusStr || ''}}</text>
					</view>
					<view class="car-info">
						<view class="line">
							<text>车场名称：</text>
							<text class="blue">{{item.parkName || ''}}</text>
						</view>
						<view class="line">
							<text>驶入时间：</text>
							<text>{{item.enterTime || ''}}</text>
						</view>
						<view class="line between">
							<view>
								<text>停车时长：</text>
								<text>{{item.durationStr || ''}}</text>
							</view>
							<text class="price">¥{{item.totalAmount || 0}}</text>
						</view>
					</view>
				</view>
			</view>
			<view class="page-result" v-else>
				<image class="page-result-icon" :src="bg_image.emptyData"></image>
				<view class="page-result-msg">暂无数据</view>
			</view>
			<uni-load-more v-if="list.length" :status="status" :content-text="contentText"
				@clickLoadMore="clickLoadMore" />
		</view>
	</view>
</template>

<script>
	import parkingRecords from './js/parkingRecords'
	
	import uniLoadMore from './components/uni-load-more/components/uni-load-more/uni-load-more.vue'
	export default {
		components: {
		  uniLoadMore
		},
		...parkingRecords
	}
</script>

<style lang="less" scoped>
	@import url('./css/parkingRecords.less');
</style>